package com.yeyks.app.controller.base.consumer;

import com.yeyks.app.annotation.LoadUserId;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.consumer.param.UserAccountOverview.*;
import com.yeyks.consumer.service.UserAccountOverviewService;
import com.yeyks.consumer.vo.UserAccountOverviewInfoVo;
import com.yeyks.consumer.vo.UserAccountOverviewInviteDetailVo;
import com.yeyks.consumer.vo.UserAccountOverviewInvitedUserListVo;
import com.yeyks.consumer.vo.UserAccountOverviewWithdrawalInquiryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author fuchangshuai
 * @date 2019/4/26 0026
 */
@Api(tags = "用户账户接口", description = "用户账户")
@Slf4j
@RestController
@RequestMapping(value = "/app/account")
public class UserAccountOverviewController {

    @Autowired
    private UserAccountOverviewService userAccountOverviewService;

    @ApiOperation(value = "我的推广页面接口:v3.6.1")
    @PostMapping(value = "/info")
    public AjaxResponseBody<UserAccountOverviewInfoVo> info(@Validated @LoadUserId UserAccountOverviewInfoParam param) {
        return AjaxResponseBody.success(userAccountOverviewService.info(param));
    }

    @ApiOperation(value = "用户提现展示接口:v3.6.1")
    @PostMapping(value = "/withdrawalInquiry")
    public AjaxResponseBody<UserAccountOverviewWithdrawalInquiryVo> withdrawalInquiry(@Validated @LoadUserId UserAccountOverviewinvitedAmountParam param) {
        return AjaxResponseBody.success(userAccountOverviewService.invitedAmount(param));
    }

    @ApiOperation(value = "推荐用户信息列表:v4.3.0")
    @PostMapping(value = "/invitedUser")
    public AjaxResponseBody<List<UserAccountOverviewInvitedUserListVo>> invitedUserList(@Validated @LoadUserId UserAccountOverviewInvitedUserListParam param) {
        return AjaxResponseBody.success(userAccountOverviewService.invitedUserList(param));
    }

    @ApiOperation(value = "推广详情页面接口:v3.5")
    @PostMapping(value = "/invitedDetail")
    public AjaxResponseBody<UserAccountOverviewInviteDetailVo> invitedDetail(@Validated @LoadUserId UserAccountOverviewInviteDetailParam param) {
        return AjaxResponseBody.success(userAccountOverviewService.invitedDetail(param));
    }

    @ApiOperation(value = "推手排行:v4.3.0")
    @PostMapping(value = "/makerLeaderboardList")
    public AjaxResponseBody<UserAccountOverviewMakerLeaderboardListVo> makerLeaderboardList() {
        return AjaxResponseBody.success(userAccountOverviewService.makerLeaderboardList());
    }

}
